package com.example.associationmanager.addTest;

import com.baomidou.mybatisplus.annotation.TableId;
import com.example.associationmanager.bean.People;
import com.example.associationmanager.service.PeopleService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;
import java.util.UUID;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest
public class AddPeople {
    @Autowired
    private PeopleService peopleService;
    @Test
    public  void test() {

        String peopleNumber;//学号
        String peopleName;//姓名
        String peopleGender="女";//性别
        Integer peopleAge=15;//年龄
        String peopleClass="医药20-5";//班级
        String peoplePhone="15815987536";//手机号
        String peopleRank="普通社员";//身份
        String peopleElses="我是爱好者";//其他信息
        Integer communityNumber=8;//社团编号
        Integer peopleStatus=0;//状态

        for(int i=600;i<650;i++){
            peopleName="司"+ UUID.randomUUID().toString().substring(1,3)+"飞";
            People people= new People(String.valueOf(i),peopleName,peopleGender,peopleAge,peopleClass,peoplePhone,peopleRank,peopleElses,communityNumber,peopleStatus);
            peopleService.save(people);//向数据库进行人员对象的插入
            System.out.println("插入成功"+people.toString());

        }

    }

}
